<?php 
namespace Admin\Controller;
use Think\Controller;
class SearchController extends Controller{
	
	public function __construct(){
		parent::__construct();
		layout(false);
		$this->db = D('Search');
	}
	
	/**
	 * 修改搜索模型
	 */
	public function add(){
		$list = $this->db->getModel();
		$this->assign(array(
				'list'=>$list,
		));
		$this->display();
		
	}
	
	/**
	 *搜索模型列表 
	 */
	public function lists(){
		if(!empty($_POST)){
			$arr = $_POST['model'];
			$this->db->saveData($arr);
			closewindow();
			exit();
		}
		 $list = $this->db->getList();
		  $this->assign(array(
		  		'list'=>$list,
		  ));
		  $this->display();
		
	}
	
	/**
	 * 更新 关键字
	 */
	public function upKey(){
		echo $this->db->upKey();
		exit();
	}
	
}


?>